<template>
	<view class="layout">
		<scroll-view scroll-x scroll-y="true" class="scroll" ref="scroll">
			<view>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quod quam voluptatum inventore, quidem expedita nam.</view>
		</scroll-view>	
		<life-demo style="margin: 15px 5px; padding: 10px;" v-if="show">Lorem ipsum dolor, sit amet consectetur adipisicing elit. Aspernatur, eligendi.</life-demo>
	</view>
</template>

<script setup>
import {onMounted, ref, onBeforeUnmount} from "vue";
const scroll = ref(null);
const show = ref(true);

const timer = setTimeout(()=>{
	show.value = false
},2000)


onMounted(()=>{
	console.log(scroll.value);
})

// 需要把定时器给关闭
onBeforeUnmount(() => {
  clearInterval(timer);
  console.log('定时器已清除');
})
</script>

<style lang="scss" scoped>

</style>
